﻿
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Yoozoo.Gameplay.CityEditor
{
    [CustomEditor(typeof(RoomEventEditorManager))]
    public class RoomEventEditor : UnityEditor.Editor
    {
        // private static string configPath = $"{Application.dataPath}/../Lua/modules/city/config/cityAIEventConfig.lua";
        private RoomEventEditorManager _eventEditorManager;
        private void OnEnable()
        {
            _eventEditorManager = target as RoomEventEditorManager;
        }
        public static void UpdateCityConfig()
        {
            // var jsonText = AssetDatabase.LoadAssetAtPath<TextAsset>(configPath);
            // _featureConfig = JsonUtility.FromJson<CityFeatureConfig>(jsonText.text);
        }

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            serializedObject.Update();
            if (GUILayout.Button("导出房间数据",GUILayout.Height(30)))
            { 
                var configPath = $"{Application.dataPath}/../Lua/modules/city/config/cityAIEventConfig.lua";
                //_eventEditorManager.SetEditing(false);
                _eventEditorManager.Save(configPath);
            }
            
        }
    }
}
